package com.cn.wanxi.util.utils;

import com.cn.wanxi.util.model.RouteModel;

import java.util.ArrayList;
import java.util.List;

public class RouteUtile {
    FileUtile fileUtile = new FileUtile();
    public List<RouteModel> readFileUtile(){
        List<RouteModel> routeModelList =new ArrayList<>();
        String routeText =fileUtile.readFileToString("RouteFile.txt");
        String[] routes =routeText.split(";");
        for (int i=0;i<routes.length;i++){
            String item =routes[i];
            String[] info =item.split(",");
            RouteModel routeModel =new RouteModel(info[0].trim(),info[1].trim(),info[2].trim());
            routeModelList.add(routeModel);
        }
        return routeModelList;
    }
}
